package GUI.Ventas.Facturacion;

import java.util.ArrayList;

import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;

import article.entities.ArticleVO;

public class ClientePorCedula extends Dialog {

	protected Object result;
	protected Shell shell;
	private Text cedula;
	ArrayList<String> esp;
	ArrayList <ArticleVO> ar;
	int p;
	/**
	 * Create the dialog.
	 * @param parent
	 * @param style
	 */
	public ClientePorCedula(Shell parent, int style, ArrayList<ArticleVO> articulos, ArrayList<String> es, int padre) {
		super(parent, style);
		setText("Buscar Cliente");
		ar=articulos;
		esp=es;
		p=padre;
	}

	/**
	 * Open the dialog.
	 * @return the result
	 */
	public Object open() {
		createContents();
		shell.open();
		shell.layout();
		Display display = getParent().getDisplay();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	private void createContents() {
		shell = new Shell(getParent(), getStyle());
		shell.setSize(390, 168);
		shell.setText(getText());
		shell.setLayout(new FormLayout());
		
		Label lblCedulaCliente = new Label(shell, SWT.NONE);
		FormData fd_lblCedulaCliente = new FormData();
		fd_lblCedulaCliente.top = new FormAttachment(0, 57);
		fd_lblCedulaCliente.left = new FormAttachment(0, 10);
		lblCedulaCliente.setLayoutData(fd_lblCedulaCliente);
		lblCedulaCliente.setText("Cedula Cliente");
		
		cedula = new Text(shell, SWT.BORDER);
		FormData fd_cedula = new FormData();
		fd_cedula.right = new FormAttachment(lblCedulaCliente, 162, SWT.RIGHT);
		fd_cedula.left = new FormAttachment(lblCedulaCliente, 43);
		fd_cedula.bottom = new FormAttachment(lblCedulaCliente, 0, SWT.BOTTOM);
		cedula.setLayoutData(fd_cedula);
		
		Button btnBuscae = new Button(shell, SWT.NONE);
		FormData fd_btnBuscae = new FormData();
		fd_btnBuscae.bottom = new FormAttachment(lblCedulaCliente, 0, SWT.BOTTOM);
		fd_btnBuscae.right = new FormAttachment(100, -39);
		btnBuscae.setLayoutData(fd_btnBuscae);
		btnBuscae.setText("Buscar");

	}
}
